package com.mapper;

import com.pojo.SalesOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 销售订单映射器
 *
 * @author admin
 * @date 2023/06/20
 */
@Mapper
public interface SalesOrderMapper {
    /**
     * 添加销售订单
     *
     * @return int
     */
    //添加销售订单表
    int addSalesOrder(SalesOrder salesOrder);

    /**
     * 更新销售订单
     *
     * @param salesOrder 销售订单
     * @return int
     *///根据订单号修改总金额
    int updateSalesOrder(SalesOrder salesOrder);

    /**
     * 按id更新状态
     *
     * @param stateId      状态id
     * @param salesOrderId 销售订单id
     * @return int
     *///根据销售订单id修改订单状态
    int updateStatesById(@Param("stateId") Long stateId, @Param("salesOrderId") Long salesOrderId);

    /**
     * 查询销售订单
     *
     * @param salesOrderId 销售订单id
     * @return {@link SalesOrder}
     *///根据销售订单查询全部
    SalesOrder QuerySalesOrder(Long salesOrderId);


    /**
     * 查询销售订单
     *
     * @param CustomPhone 客户电话号码
     * @return {@link SalesOrder}
     *///根据客户电话查询该客户的购买商品信息
    List<SalesOrder> Customphone(@Param("customPhone") String CustomPhone);

    List<SalesOrder> QueryByCustomPhone(String customPhone);
}
